using System;
using System.Text;
using System.Collections;

namespace Org.EasyWeb.Upload
{
	public class UploadedFileCollection : CollectionBase
	{
		public UploadedFileCollection()
		{
		}

		public UploadedFile this[int i]
		{
			get
			{
				return (UploadedFile)(List[i]);
			}
		}

		public void Add(UploadedFile file)
		{
			List.Add(file);
		}

		public void AddRange(UploadedFileCollection collection) 
		{
			foreach (UploadedFile file in collection)
				Add(file);
		}

		public static UploadedFileCollection ReadOnly(UploadedFileCollection collection)
		{
			if (collection == null)
			{
				throw new ArgumentNullException("collection - UploadedFileCollection");
			}
			UploadedFileCollection newColl = new UploadedFileCollection();
			newColl.AddRange(collection);
			return newColl;
		}
	}
}
